﻿using System.ComponentModel.DataAnnotations;

namespace WeChat.Entity
{
    /// <summary>
    /// 菜单
    /// </summary>
    public class WeChatMenu : BaseEntity<int>, IsActivate
    {
        #region 常量
        /// <summary>
        /// 菜单名长度
        /// </summary>
        public const int MenuNameLength = 20;
        /// <summary>
        /// 控制器长度
        /// </summary>
        public const int ControllerLength = 50;
        /// <summary>
        /// Action长度
        /// </summary>
        public const int ActionLength = 50;
        #endregion

        /// <summary>
        /// 菜单名
        /// </summary>
        [Required]
        [StringLength(MenuNameLength)]
        public string MenuName { get; set; }

        /// <summary>
        /// 控制器名
        /// </summary>
        [Required]
        [StringLength(ControllerLength)]
        public string ControllerName { get; set; }

        /// <summary>
        /// Action名
        /// </summary>
        [Required]
        [StringLength(ActionLength)]
        public string ActionName { get; set; }

        /// <summary>
        /// 父节点Id
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int OrderBy { get; set; }

        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActivate { get; set; }
    }
}
